package ac.neec.mio.ui.adapter;

import java.util.List;

import ac.neec.mio.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class SearchSelectListAdapter extends ArrayAdapter<String> {

	private Context context;
	private LayoutInflater inflater;
	private List<String> selectMenu;

	public SearchSelectListAdapter(Context context, int resource, List<String> selectMenu) {
		super(context, resource, selectMenu);

		this.context = context;
		this.selectMenu = selectMenu;

		inflater = (LayoutInflater) context.getSystemService(
				Context.LAYOUT_INFLATER_SERVICE);

	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.select_list_item, null);
		}
		TextView txt = (TextView)convertView.findViewById(R.id.text_major);
		txt.setText(selectMenu.get(position));
		return convertView;
	}

}
